IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spTnotify_Create')
	BEGIN
		PRINT 'Dropping Procedure spTnotify_Create'
		DROP  Procedure  spTnotify_Create
	END

GO

PRINT 'Creating Procedure spTnotify_Create'
GO
CREATE Procedure dbo.spTnotify_Create
	( 	  
	  @msgtype char(8) = null, 
		@empno char(10) = null, 
		@tfileno char(20) = null, 
		@ILPno char(20) = null, 
		@msgtxt char(255) = null, 
		@fstatus char(10) = null, 
		@tdatetime DateTime = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 9/6/2007    Initial version created
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Create the required new record
	INSERT INTO Tnotify
	  (
		msgtype,
			empno,
			tfileno,
			ILPno,
			msgtxt,
			fstatus,
			tdatetime	  
	  )
	VALUES
	  (
		@msgtype,
			@empno,
			@tfileno,
			@ILPno,
			@msgtxt,
			@fstatus,
			@tdatetime
	  )

	-- Handle any errors
	IF @@ERROR != 0
	BEGIN
		RAISERROR('spTnotify_Create: Unable to Insert a new Tnotify', 10, 1)
		RETURN
	END

	-- Return the newly created ID
	SELECT	@@IDENTITY AS 'Tnotify_ID'

	-- Return to calling method
	RETURN 

GO
